package com.xiaozhichao.web.nowebxml;

import com.xiaozhichao.web.servlet.HelloWorld;

import javax.servlet.ServletRegistration;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;


public abstract class AbstractWebApplicatioInitializer implements WebApplicationInitializer{
    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        ServletRegistration.Dynamic dynamic = servletContext.addServlet("helloWorld", new HelloWorld());

        dynamic.setLoadOnStartup(1);
        dynamic.addMapping("/hello");
        dynamic.setAsyncSupported(true);
    }
}
